package com.nbjtjc.safe.bean.runnable;

import com.nbjtjc.safe.model.danger.DangerInspectTableLabel;
import com.nbjtjc.safe.service.danger.DangerInspectTableLabelService;

import java.util.concurrent.Callable;

/**
 * @auther guqianbin
 * @date 2018/8/6 14:47
 **/
public class InitDangerLabelRunnable implements Callable<Boolean> {

    private int fromCompanyId;
    private int toCompanyId;
    private DangerInspectTableLabelService dangerInspectTableLabelService;

    public InitDangerLabelRunnable() {
    }

    public InitDangerLabelRunnable(int fromCompanyId
            , int toCompanyId, DangerInspectTableLabelService dangerInspectTableLabelService) {
        this.fromCompanyId = fromCompanyId;
        this.toCompanyId = toCompanyId;
        this.dangerInspectTableLabelService = dangerInspectTableLabelService;
    }

    @Override
    public Boolean call() throws Exception {
        if(!dangerInspectTableLabelService.copyLabelStructure(fromCompanyId,toCompanyId)){
            return false;
        }
        return true;
    }
}
